package fr.babos.utils 
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.events.Event;
	import flash.events.EventPhase;
	/**
	 * @author ZoulouX
	 */
	public class EventUtils 
	{
		public static function dispatchBubblingEvent (pEvent:Event, pTarget:DisplayObject):void
		{
			// ATTENTION, ON NE PEUT PAS SET L'EVENTPHASE
			
			/*
			var parents:Vector.<DisplayObjectContainer> = DisplayObjectUtils.getParentsOf(pTarget);
			
			var total:uint = parents.length;
			var i:int;
			var event:Event;
			
			// Dispatcher la montée
			for (i = 0; i < total; i++)
			{
				event = pEvent.clone();
				event.eventPhase = EventPhase.CAPTURING_PHASE;
				
				parents[i].dispatchEvent(event);
			}
			
			// Dispatcher sur le target
			event = pEvent.clone();			
			event.eventPhase = EventPhase.AT_TARGET;
			
			pTarget.dispatchEvent(event);
			
			// Dispatcher la descente
			for (i = total; i >= 0; i--)
			{
				event = pEvent.clone();
				event.eventPhase = EventPhase.BUBBLING_PHASE;
				
				parents[i].dispatchEvent(event);
			}
			*/
		}
	}
}